<?php
	function system_set_access(){
		$check =false;
		$user_id= db_fetch_cell("select id from user_auth where id=" . $_SESSION["sess_user_id"]);
		$user_id=(int)$user_id;
		$realms_id_alarm = db_fetch_cell("select id from plugin_realms where plugin ='nms-alarm'");
		$realms_id_alarm1 = (int)$realms_id_alarm +100;
		$realms_id_alarm1=(int)$realms_id_alarm1;
		$result = db_fetch_cell('SELECT realm_id FROM user_auth_realm where realm_id ='.$realms_id_alarm1.' and user_id ='.$user_id.'');
		if(!empty($result)){
			$check = true;
		}
		return $check;
	}
	function system_set_access_2(){
		$check =false;
		$user_id= db_fetch_cell("select id from user_auth where id=" . $_SESSION["sess_user_id"]);
		$user_id=(int)$user_id;
		$realms_id_pause = db_fetch_cell("select id from plugin_realms where plugin ='nms-pause'");
		$realms_id_pause1 = (int)$realms_id_pause +100;
		$realms_id_pause1=(int)$realms_id_pause1;
		$result = db_fetch_cell('SELECT realm_id FROM user_auth_realm where realm_id ='.$realms_id_pause1.' and user_id ='.$user_id.'');
		if(!empty($result)){
			$check = true;
		}
		return $check;
	}
	function system_set_access_1(){
		$check =false;
		$user_id= db_fetch_cell("select id from user_auth where id=" . $_SESSION["sess_user_id"]);
		$user_id=(int)$user_id;
		$realms_id_setting = db_fetch_cell("select id from plugin_realms where plugin ='nms-setting'");
		$realms_id_setting1=(int)$realms_id_setting +100;
		$realms_id_setting1=(int)$realms_id_setting1;
		$result1=db_fetch_cell('SELECT realm_id FROM user_auth_realm where realm_id = '.$realms_id_setting1.' and user_id ='.$user_id.'');
		if(!empty($result1)){
			$check = true;
		}
		return $check;
	}
?>